import React from "react";
import {Link} from "react-router";
import ImageText from "../components/imagetext";

export default class Guoji extends React.Component{

	constructor(){
		super();
		this.state = {
			GuojiNews:[]
		}
	}

	componentDidMount(){
		var result = fetch("http://www.wwtliu.com/sxtstu/news/juhenews.php?type="+this.props.type+"&count="+this.props.count,{
			method:"get"
		})
		.then(res => {
			return res.json();
		})
		.then(json => {
			this.setState({
				GuojiNews:json
			})
		})
	}
	render(){
		var newsCount=6;
		return(
			<div>
				<div className="details">
					<Link to={`/details`}>
						跳转到自己的详情页
					</Link>
				</div>
				<ImageText type="guoji" count={newsCount}></ImageText>
			</div>
		)
	}
}